* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

header {
    background-color: #333;
    color: white;
    padding: 1rem;
    background: linear-gradient(to right, #2d3748, #1a202c);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #f7fafc;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

nav a:hover {
    background-color: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

nav a.active {
    background-color: rgba(255,255,255,0.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logout-link {
    color: #ff6b6b !important;
    margin-left: auto;
    border: 1px solid rgba(255,107,107,0.3);
}

.logout-link:hover {
    background-color: rgba(255,107,107,0.2) !important;
    border-color: rgba(255,107,107,0.5);
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #f7fafc;
    min-height: calc(100vh - 120px);
}

.section {
    margin-bottom: 2rem;
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.section h2 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls {
    margin: 1rem 0;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 0.5rem;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #4a5568;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background-color: #f8fafc;
}

button {
    padding: 0.5rem 1rem;
    background: linear-gradient(to right, #4299e1, #3182ce);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66,153,225,0.25);
}

button:active {
    transform: translateY(0);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 70%;
    max-width: 500px;
    position: relative;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 10px;
    top: 5px;
    font-size: 24px;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.button-danger {
    background: linear-gradient(to right, #f56565, #e53e3e);
}

.button-danger:hover {
    background: linear-gradient(to right, #e53e3e, #c53030);
    box-shadow: 0 4px 8px rgba(229,62,62,0.25);
}

.button-success {
    background-color: #28a745;
}

select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.status-borrowed {
    color: #dc3545;
}

.status-returned {
    color: #28a745;
}

.stats-panel {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex: 1;
}

.stat-card h3 {
    color: #666;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.stat-card p {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.overdue {
    color: #dc3545 !important;
}

.warning {
    color: #ffc107 !important;
}

tr.overdue-row {
    background-color: #fff3f3;
}

tr.warning-row {
    background-color: #fff8e6;
}

.pagination {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.button-secondary {
    background: linear-gradient(to right, #718096, #4a5568);
}

.button-secondary:hover {
    background: linear-gradient(to right, #4a5568, #2d3748);
}

#page-info {
    min-width: 100px;
    text-align: center;
}

.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 加载状态指示器 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading.active {
    display: flex;
}

.loading::after {
    content: "加载中...";
    font-size: 1.2rem;
    color: #333;
}

/* 表格样式优化 */
table thead th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    cursor: pointer;
}

table thead th:hover {
    background-color: #e9ecef;
}

table thead th::after {
    content: "⇅";
    margin-left: 5px;
    color: #999;
}

table thead th.sort-asc::after {
    content: "↑";
    color: #333;
}

table thead th.sort-desc::after {
    content: "↓";
    color: #333;
}

/* 表格行悬停效果 */
table tbody tr:hover {
    background-color: #f5f5f5;
}

/* 按钮悬停效果 */
button:hover {
    opacity: 0.9;
}

button:active {
    transform: translateY(1px);
}

/* 搜索框样式 */
input[type="search"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 200px;
    background-color: white;
    transition: all 0.3s ease;
}

input[type="search"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* 统计卡片动画效果 */
.stat-card {
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

/* 登录页面样式 */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    animation: wave 15s linear infinite;
}

@keyframes wave {
    from { transform: rotate(45deg) translateY(0); }
    to { transform: rotate(45deg) translateY(-50%); }
}

.login-container {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    position: relative;
    width: 100%;
    max-width: 400px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.login-container:hover {
    transform: translateY(-5px);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.login-header h2 {
    font-size: 1.75rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-header p {
    color: #718096;
    font-size: 0.9rem;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.login-form label {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.login-form input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(66,153,225,0.15);
    background-color: #fff;
}

.logout-link {
    color: #ff6b6b !important;
    margin-left: auto;
}

.logout-link:hover {
    background-color: rgba(255,107,107,0.2) !important;
}

/* 密码输入框样式 */
input[type="password"] {
    letter-spacing: 0.3em;
}

/* 错误消息样式 */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* 表单提示信息 */
.form-note {
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* 必填字段标记 */
label[for]:after {
    content: "*";
    color: #dc3545;
    margin-left: 4px;
}

/* 可选字段标记 */
label[for="phone"]:after {
    content: "(选填)";
    color: #666;
    font-size: 0.875rem;
    margin-left: 4px;
}

/* 表格排序样式 */
th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 20px; /* 为排序图标留出空间 */
}

th.sortable::after {
    content: "⇅";
    position: absolute;
    right: 5px;
    color: #999;
    font-size: 0.8em;
}

th.sortable:hover {
    background-color: #e9ecef;
}

th.sort-asc::after {
    content: "↑";
    color: #333;
}

th.sort-desc::after {
    content: "↓";
    color: #333;
}

/* 移除非排序列的指示器和悬停效果 */
th:not(.sortable) {
    cursor: default;
}

th:not(.sortable):hover {
    background-color: #f8f9fa;
}

th:not(.sortable)::after {
    content: none;
}

/* 分页信息样式 */
#page-info-borrowings {
    min-width: 80px;
    text-align: center;
}

/* 忘记密码链接样式 */
.forgot-password-link {
    display: block;
    text-align: right;
    color: #4299e1;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password-link:hover {
    text-decoration: underline;
    color: #2b6cb0;
}

.login-button {
    width: 100%;
    padding: 0.75rem !important;
    font-size: 1rem !important;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #4299e1, #3182ce);
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.login-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(to right, #3182ce, #2c5282);
    box-shadow: 0 4px 12px rgba(66,153,225,0.3);
}

.register-button {
    width: 100%;
    padding: 0.75rem !important;
    font-size: 1rem !important;
    background: transparent;
    color: #4299e1;
    border: 2px solid #4299e1;
    font-weight: 500;
    transition: all 0.3s ease;
}

.register-button:hover {
    background-color: rgba(66,153,225,0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66,153,225,0.15);
}

/* 注册模态框样式 */
.modal-content h3 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
}

#register-form {
    max-width: 400px;
    margin: 0 auto;
    padding: 0 1rem 0.5rem;
}

#register-form .form-group {
    margin-bottom: 1rem;
    position: relative;
}

#register-form label {
    color: #4a5568;
    font-weight: 500;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.25rem;
}

#register-form input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

#register-form input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 4px rgba(66,153,225,0.15);
    background-color: #fff;
}

#register-form input::placeholder {
    color: #a0aec0;
    font-size: 0.875rem;
}

.password-strength {
    position: absolute;
    bottom: -16px;
    left: 0;
    font-size: 0.75rem;
    color: #718096;
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.form-footer p {
    color: #718096;
    font-size: 0.875rem;
}

.form-footer a {
    color: #4299e1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.form-footer a:hover {
    color: #2b6cb0;
    text-decoration: underline;
}

#register-form .button-success {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    background: linear-gradient(to right, #48bb78, #38a169);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

#register-form .button-success:hover {
    transform: translateY(-2px);
    background: linear-gradient(to right, #38a169, #2f855a);
    box-shadow: 0 4px 12px rgba(72,187,120,0.3);
}

#register-form .button-danger {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    background: transparent;
    color: #e53e3e;
    border: 2px solid #e53e3e;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#register-form .button-danger:hover {
    background-color: rgba(229,62,62,0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229,62,62,0.15);
}

/* 注册表单按钮组样式 */
#register-form .button-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* 手机号输入框特殊样式 */
#register-phone {
    letter-spacing: 1px;
}

/* 密码输入框特殊样式 */
#register-password,
#register-confirm-password {
    letter-spacing: 0.3em;
}

/* 表单验证提示 */
#register-form input:invalid {
    border-color: #fc8181;
}

#register-form input:invalid:focus {
    border-color: #fc8181;
    box-shadow: 0 0 0 4px rgba(252,129,129,0.15);
}

.modal-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 1.75rem;
    color: #2d3748;
    font-weight: 600;
    margin: 0;
}

#register-form .button-success {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    background: linear-gradient(to right, #48bb78, #38a169);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

#register-form .button-success:hover {
    transform: translateY(-2px);
    background: linear-gradient(to right, #38a169, #2f855a);
    box-shadow: 0 4px 12px rgba(72,187,120,0.3);
}

#register-form .button-danger {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    background: transparent;
    color: #e53e3e;
    border: 2px solid #e53e3e;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#register-form .button-danger:hover {
    background-color: rgba(229,62,62,0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229,62,62,0.15);
}

/* 注册表单按钮组样式 */
#register-form .button-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* 手机号输入框特殊样式 */
#register-phone {
    letter-spacing: 1px;
}

/* 密码输入框特殊样式 */
#register-password,
#register-confirm-password {
    letter-spacing: 0.3em;
}

/* 表单验证提示 */
#register-form input:invalid {
    border-color: #fc8181;
}

#register-form input:invalid:focus {
    border-color: #fc8181;
    box-shadow: 0 0 0 4px rgba(252,129,129,0.15);
} 